/**
 * 
 */
package com.firebird.oms.dao.sm;

import java.util.List;

import com.firebird.base.orm.hibernate.EntityHibernateDao;
import com.firebird.oms.domain.sm.TismMenu;

/**
 * @author Administrator
 *
 */
public class TismMenuDao extends EntityHibernateDao<TismMenu> {
	
	final static String sql = "select * from tism_menu order by menu_code desc limit 1";

	@SuppressWarnings("unchecked")
	public int getMaxMenuCode() {
		List<TismMenu> ls = (List<TismMenu>) super.getSession().createSQLQuery(sql).addEntity(TismMenu.class).list();
		if (ls != null && ls.size() > 0) {
			return ls.get(0).getMenuCode() + 1;
		}

		return 1;
	}

}
